[
    {
        "id": "4f55a344bb541810",
        "type": "tab",
        "label": "Send Values To Channel",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "36aeab613c4299d9",
        "type": "function",
        "z": "4f55a344bb541810",
        "name": "Random Value 18-25",
        "func": "function getRandomFloatInclusive(min, max) {\n  min = Math.ceil(min);\n  max = Math.floor(max);\n  var rawNumber = (Math.random() * (max - min + 1) + min); // The maximum is inclusive and the minimum is inclusive\n  return Math.round((rawNumber + Number.EPSILON) * 10) / 10;\n\n}\n\nmsg.payload = `${getRandomFloatInclusive(18, 25)}`;\nnode.status({fill: \"green\", shape: \"dot\", text: msg.payload});\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "// Code added here will be run once\n// whenever the node is started.\nnode.status({ fill: \"grey\", shape: \"dot\", text: \"off\" });",
        "finalize": "",
        "libs": [],
        "x": 640,
        "y": 180,
        "wires": [
            [
                "517e54e1797828ec"
            ]
        ]
    },
    {
        "id": "517e54e1797828ec",
        "type": "switch",
        "z": "4f55a344bb541810",
        "name": "First Run?",
        "property": "#:(file)::savedChannelId",
        "propertyType": "flow",
        "rules": [
            {
                "t": "null"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 890,
        "y": 180,
        "wires": [
            [
                "43ba545769c6ceca"
            ],
            [
                "62d9071598d16562"
            ]
        ]
    },
    {
        "id": "f25be305b3e17085",
        "type": "comment",
        "z": "4f55a344bb541810",
        "name": "Simulates a sensor periodically sending a value for 2 minutes to a new channel, then the flow is stopped",
        "info": "",
        "x": 410,
        "y": 60,
        "wires": []
    },
    {
        "id": "07b8748966175b2e",
        "type": "inject",
        "z": "4f55a344bb541810",
        "name": "Start",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "10",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 130,
        "y": 180,
        "wires": [
            [
                "15406208bd3d60c6"
            ]
        ]
    },
    {
        "id": "fd215e6f5af9f432",
        "type": "comment",
        "z": "4f55a344bb541810",
        "name": "Simulate Sensor value",
        "info": "",
        "x": 640,
        "y": 140,
        "wires": []
    },
    {
        "id": "43ba545769c6ceca",
        "type": "smeSender",
        "z": "4f55a344bb541810",
        "connector": "",
        "async": "0",
        "name": "",
        "actionName": "channel_create",
        "actionText": "Channel - Create",
        "recipientId": "",
        "recipientIdType": "str",
        "messageId": "",
        "messageIdType": "str",
        "limit": 0,
        "limitType": "num",
        "recipientIds": "",
        "recipientIdsType": "str",
        "groupChatId": "",
        "groupChatIdType": "str",
        "channelId": "",
        "channelIdType": "str",
        "title": "sensorChannel",
        "titleType": "str",
        "saveLocation": "#:(file)::savedChannelId",
        "saveLocationType": "flow",
        "saveRequestIdLocation": "savedRequestId",
        "saveRequestIdLocationType": "msg",
        "logToConsole": false,
        "x": 1220,
        "y": 180,
        "wires": [
            [
                "62d9071598d16562"
            ]
        ]
    },
    {
        "id": "62d9071598d16562",
        "type": "smeMessage",
        "z": "4f55a344bb541810",
        "name": "Text Message",
        "message": "text",
        "text": "payload",
        "textType": "msg",
        "html": "<b>This is an html message</b>",
        "htmlType": "str",
        "fileIds": "",
        "fileIdsType": "str",
        "contactIds": "",
        "contactIdsType": "str",
        "locationName": "myLocation",
        "locationNameType": "str",
        "latitude": "",
        "latitudeType": "str",
        "longitude": "",
        "longitudeType": "str",
        "url": "",
        "urlType": "str",
        "enableFullScreenView": "1",
        "viewSize": "1:2",
        "channelId": "",
        "channelIdType": "str",
        "tunnelId": "",
        "tunnelIdType": "str",
        "formLocation": "savedForm",
        "formLocationType": "flow",
        "x": 660,
        "y": 300,
        "wires": [
            [
                "265c9edf54a182fc"
            ]
        ]
    },
    {
        "id": "2abd7828d5866352",
        "type": "smeSender",
        "z": "4f55a344bb541810",
        "connector": "",
        "async": "0",
        "name": "",
        "actionName": "channel_message_send",
        "actionText": "Channel - Send Message",
        "recipientId": "",
        "recipientIdType": "str",
        "messageId": "",
        "messageIdType": "str",
        "limit": 0,
        "limitType": "num",
        "recipientIds": "",
        "recipientIdsType": "str",
        "groupChatId": "",
        "groupChatIdType": "str",
        "channelId": "#:(file)::savedChannelId",
        "channelIdType": "flow",
        "title": "",
        "titleType": "str",
        "saveLocation": "#:(file)::savedMessageId",
        "saveLocationType": "flow",
        "saveRequestIdLocation": "savedRequestId",
        "saveRequestIdLocationType": "msg",
        "logToConsole": true,
        "x": 1250,
        "y": 280,
        "wires": [
            []
        ]
    },
    {
        "id": "265c9edf54a182fc",
        "type": "switch",
        "z": "4f55a344bb541810",
        "name": "First Message?",
        "property": "#:(file)::savedMessageId",
        "propertyType": "flow",
        "rules": [
            {
                "t": "null"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 920,
        "y": 300,
        "wires": [
            [
                "2abd7828d5866352"
            ],
            [
                "7c1a323d6a5eaac5"
            ]
        ]
    },
    {
        "id": "7c1a323d6a5eaac5",
        "type": "smeSender",
        "z": "4f55a344bb541810",
        "connector": "",
        "async": "0",
        "name": "",
        "actionName": "channel_message_update",
        "actionText": "Channel - Update Message",
        "recipientId": "",
        "recipientIdType": "str",
        "messageId": "#:(file)::savedMessageId",
        "messageIdType": "flow",
        "limit": 0,
        "limitType": "num",
        "recipientIds": "",
        "recipientIdsType": "str",
        "groupChatId": "",
        "groupChatIdType": "str",
        "channelId": "",
        "channelIdType": "str",
        "title": "",
        "titleType": "str",
        "saveLocation": "savedEntityId",
        "saveLocationType": "msg",
        "saveRequestIdLocation": "savedRequestId",
        "saveRequestIdLocationType": "msg",
        "logToConsole": true,
        "x": 1240,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "2b88d93c2806e70d",
        "type": "delay",
        "z": "4f55a344bb541810",
        "name": "Stop timer 2 mins",
        "pauseType": "delay",
        "timeout": "2",
        "timeoutUnits": "minutes",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 230,
        "y": 280,
        "wires": [
            [
                "271e876468ea1578"
            ]
        ]
    },
    {
        "id": "15406208bd3d60c6",
        "type": "switch",
        "z": "4f55a344bb541810",
        "name": "Timer running?",
        "property": "#:(file)::stop",
        "propertyType": "flow",
        "rules": [
            {
                "t": "null"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 1,
        "x": 400,
        "y": 180,
        "wires": [
            [
                "36aeab613c4299d9"
            ]
        ]
    },
    {
        "id": "312a93283d56f658",
        "type": "inject",
        "z": "4f55a344bb541810",
        "name": "Auto Stop",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 140,
        "y": 240,
        "wires": [
            [
                "2b88d93c2806e70d"
            ]
        ]
    },
    {
        "id": "271e876468ea1578",
        "type": "change",
        "z": "4f55a344bb541810",
        "name": "Set Stop flag",
        "rules": [
            {
                "t": "set",
                "p": "#:(file)::stop",
                "pt": "flow",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 290,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "2d2585c6354ab466",
        "type": "inject",
        "z": "4f55a344bb541810",
        "name": "Restart",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 130,
        "y": 380,
        "wires": [
            [
                "b0c8157f9f55fa9d"
            ]
        ]
    },
    {
        "id": "b0c8157f9f55fa9d",
        "type": "change",
        "z": "4f55a344bb541810",
        "name": "Reset Stop flag",
        "rules": [
            {
                "t": "delete",
                "p": "#:(file)::stop",
                "pt": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 300,
        "y": 380,
        "wires": [
            []
        ]
    }
]